<template>
  <div class="Myclients">
        <div class="gr_title">
      <div class="fan" @click="fanhui">
        <img src="../assets/images/fanhui.png" height="21px" alt="" />
      </div>
      客户列表信息
      <div>
        <span @click="xinzeng">新增</span>
      </div>
    </div>
      <van-search
            v-model="value"
            show-action
            placeholder="客户名称/联系方式"
            >
            <template #action>
                <div @click="onSearch">搜索</div>
            </template>
        </van-search>

      <!-- 客户列表 -->
      <div class="dange" v-for="(item,index) in arr" :key="index">
        <div class="neir" @click="kehuxinxi(item.id)">
          <p>客户名称 <span>{{item.custName}}</span></p>
         <p>联系方式 <span>{{item.telephone}}</span></p>
         <p>公司名称 <span>{{item.company}}</span></p>
         <p>职务 <span>{{item.position}}</span></p>
        </div>
        <div class="anniu">
          <div class="zuhe">
          <van-button round type="info" color="#003399">新增拜访</van-button>
          <van-button round type="info" color="#003399">拜访记录</van-button>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
import { apicust,Aapicust } from "../requset/api"
export default {
  data () {
    return {
       value:'',
       //客户列表数组
       arr:[]
    }
  },
  methods:{
    xinzeng(){
      this.$router.push('/xinzeng')
    },
    onSearch(){

    },
    kehuxinxi(id){
      this.$router.push('/kehuxiangq/'+id)
    },
    fanhui(){
      this.$router.back()
    }
  },
  created(){
    let id = "1354275436906213378"
  Aapicust(id).then(res=>{
    console.log(res);
  })


   apicust({
     keyword:'',
     current:'1',
     size:'10'
   }).then(res=>{
     console.log(res);
     if(res.errCode==0){
       this.arr=res.data.records
      //  console.log(this.arr);
     }
   })
  }
}
</script>
 
<style lang = "less" scoped>
.Myclients{
  width: 100%;
  min-height: 100vh;
  background:#f5f5f5 ;
 .gr_title {
    width: 100%;
    height: 43px;
    background-color: #003399;
    background-size: 80%;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    color: #fff;
    text-align: center;
    line-height: 43px;
    padding-right: 16px;
    .fan {
      line-height: 43px;
      margin-left: 10px;
      img {
        float: left;
      }
    }
    div {
      img {
        margin-top: 10px;
      }
    }
    .active {
      opacity: 0;
    }
  }
  .dange{
    border: 1px solid #e5e5e5;
    margin-top: 10px;
    background: #fff;
    padding: 0px 22px;
    padding-top: 8px;
    .neir{
      border-bottom:1px dashed #e5e5e5 ;
      p{
        color: #b0b0b0;
        line-height: 24px;
        span{
          color: #000;
        }
      }
    }
    .anniu{
      width: 100%;
      height: 54px;
      .zuhe{
        margin-top: 12px;
        float: right;
          .van-button{
            width: 80px;
            height: 30px;
            font-size: 12px;
            margin-left: 15px;
          }
      }
    }
  }
}
 
</style>
